home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / hard / hack / ATkeyboard.lha / ATkeyboard / keyb.doc < prev    next >
Encoding:
Text File  |  1997-01-04  |  11.2 KB  |  253 lines

  1.  
  2.     «» AT-keyboard interface project by Henrik Jonsson 1996. «»
  3.     -----------------------------------------------------------
  4.         e-mail: y96he0jo@isy.liu.se
  5.  
  6. (English is not my native language so please have mercy with my way of
  7. maltreating the English language :-)
  8.  
  9.     What the heck is it?
  10.     --------------------
  11. This hardware hack makes it possible to connect & use an (PC) AT-keyboard
  12. on an Amiga. The Amiga keyboard & the AT keyboard does (ofcourse) not use
  13. the same scancodes. Therefor we need a onechip computer to convert the
  14. AT-scancodes into Amiga-scancodes. In this hack I've used a cheap, common,
  15. small, fast, RISC onechip computer by Microchip called PIC 16C84.
  16.  
  17. NOTE: This hack does not work with old (PC) XT-keyboards.
  18.  
  19.     Diclaimer
  20.     ---------
  21. Although this hack has been tested on several Amiga's, & works just
  22. great on these machines, I can *NOT* be held responsible for *ANY*
  23. damage this hack may cause, or any damage you may cause while trying
  24. to rebuild or install this hack in your computer !
  25. If you don't have much experience with projects like this, it may be a
  26. good idea to let someone else build it for you.
  27.  
  28.     Introduction
  29.     ------------
  30. I have tried to make this project as dynamic as possible so that it will be
  31. easier for the builder of this project to change it to his/her need/taste.
  32.  
  33. In this sourcecode in its present form I've made "special mission commands"
  34. on six keys, pause, "print screen", home, end, pageup, pagedown & menu95.
  35.  
  36. If you press:
  37.  
  38. *    "Pause" twice right after each other your Amiga will boot.
  39.  
  40. *    "Home" your Amiga will receive "right shift + arrow left".
  41.  
  42. *    "End" your Amiga will receive "right shift + arrow right".
  43.  
  44. *    "Pageup" your Amiga will receive "right shift + arrow up".
  45.  
  46. *    "Pagedown" your Amiga will receive "right shift + arrow down".
  47.  
  48. *    "Print Screen" your Amiga will receive "left Amiga + m".
  49.     (ie cycle screens.)
  50.  
  51. *    "menu95" your Amiga will receive "left Amiga + m".
  52.     (ie cycle screens.)
  53.  
  54. These "special mission commands" can easily be changed to do something else
  55. just by making some minor changes in the sourcecode.
  56.  
  57. If you own one of those 102+ keys keyboards it is quite easy to change
  58. the sourcecode so that you can put some usefull command into every key.
  59. If you have some experince in programming assembler you will find it
  60. very easy to change the "special mission keys" setup to your own need.
  61.  
  62. Suppose you have a non-standard AT-keyboard with alot of extra keys, & you
  63. want to use some of them to do something useful but you do not know the
  64. scancodes to those extra keys. You're in a big trouble unless you have access
  65. to a logicanalyser, but I have allready solved that problem for you.
  66. In this archieve I've included a small executable called kb-scan that will
  67. take care of the scancode problem. Kb-scan is a program that will capture
  68. the "AT-keyboard scancodes" using the Amiga paralellport & then save the
  69. scancodes into a file. Before you use kb-scan you'll have to build a very
  70. simple buffer to prevent your 8520:s from overload. The schematics on how to
  71. build the buffer can be found in kb-scan.iff. When you have connected the
  72. buffer & AT-keyboard to the paralellport you are ready to use kb-scan.
  73.  
  74. To use kb-scan is very simple, you just have to speify a filename into wich
  75. you want the scancodes to be saved & off you go. If you have connected
  76. everything correct the scroll-lock led will lit right after you have executed
  77. kb-scan. If it does not lit you'd better turn the power of imediately to
  78. lower the risc of blowing either your AT-keyboard or the Amiga-paralellport.
  79.  
  80. When the scroll-lock led is lit you just have to tap a key that you want to
  81. examine & then press left mousebutton to save the scancode into the file
  82. that you have specified.
  83.  
  84. Now you can include that scancode in the correct position in the key-lookup
  85. table in the sourcecode & associate it with some useful key/keycombination.
  86. If you don't understand were in the source to put the scancodes you could
  87. try to e-mail me the scancodes & if I have time I'll try to help you out.
  88.  
  89. Since the Amigakeyboard have some keys that the AT-keyboard doesn't have &
  90. vice versa I have made some substitutes.
  91.  
  92.     AT    >>>>>    Amiga
  93.     --------------------------
  94.     left alt    left Amiga
  95.     right alt    right Amiga
  96.     left ctrl    left alt
  97.     right ctrl    right alt
  98.     capslock    ctrl
  99.     insert        help
  100.     scrolllock    capslock
  101.     f11        \| (the key at the left from backspace)
  102.     f12        [{ (the key in the upper left corner on the keypad)
  103.     left win95    left Amiga
  104.     right win95    right Amiga
  105.  
  106. If you intend to use a win-95 keyboard & you do not like the setup described
  107. above I have included an alternative win-95 source just to show an very
  108. simple example on how to change the keylookup-table setup. In this source the
  109. changed keys have the following setup:
  110.  
  111.     AT    >>>>>    Amiga
  112.     --------------------------
  113.     left alt    left alt
  114.     right alt    right alt
  115.     left ctrl    ctrl
  116.     right ctrl    ctrl
  117.     capslock    capslock
  118.     left win95    left Amiga
  119.     right win95    right Amiga
  120.  
  121. NOTE:    I do not own a win-95 keyboard so the scancodes that I have used
  122.     for the win-95 specific keys has not been tested. If it should turn
  123.     out that they do not work as described above just use kb-scan to
  124.     get the correct scancodes.
  125.  
  126.     How's it done then?
  127.     -------------------
  128. Well, first of all you need a "PIC 16c84 programmer" so that you can put
  129. the program (keyb.hex or keyb_w95.hex) into the cpu's eeprom. As far as i
  130. know there are two Amiga programs available on the Aminet that would take
  131. care of this. These programs are Epic & "PIC kit". Both of them can be
  132. found in hard/hack as Epic1_0.lha & PICKIT09.LHA. Notice that i haven't
  133. tried neither of these but i hope that they will work just fine. In case
  134. that you have access to a pc there are several "PIC programmers" available
  135. on the internet. For example you could check out the official microchip
  136. site : www.microchip.com .
  137.  
  138. Before programming the cpu you must specify some options to the programing
  139. software you're using:
  140.  
  141. *    Power-up timer  = ON
  142. *    Watchdog timer  = OFF
  143. *    Codeprotection  = OFF
  144. *    Oscillator type = XT
  145.  
  146. As you can see in keyb.iff the circuit itself is very simple. The only thing
  147. that could be a bit tricky is if you want to connect it to an A1200. I have
  148. not included any desciption on how to connect this project to an A1200 since
  149. there are several good descriptions available on the Aminet. Most of these
  150. descriptions use a special reset-switch but that is unnecessary with this
  151. project provided that you have connected the KbReset-line to the A1200.
  152. I have not cut the KbClk & KbDat lines on my A1200-motherboard as described
  153. in most descriptions. I use the original A1200-keyboard toghether with this
  154. project & it works just great.
  155.  
  156. The +5V powersupply can be taken from the floppy powersupply or from any
  157. other suitable place were +5V is available in your Amiga. Remember that there
  158. is also +12V available in the floppy powersupply, make sure you got the right
  159. one.
  160.  
  161. To make the PCB-procedure easier I have included a PCB-layout for this
  162. project both as postscript & "HP laserjet"-file.
  163.  
  164. So far this project has only been tested on A500 & A1200. I am pretty sure
  165. of that this project will work on allmost any Amiga. The only thing that
  166. differs (as I know of) between keyboard handling on differnt Amigas
  167. is the reset signal. On A500 & A1200 there is a special resetline coming
  168. from the keyboard that will be driven low when you press ctrl+Lamiga+Ramiga.
  169. The A2/3/4/000 keyboard haven't got any resetline so instead it will drive
  170. the clock line low for atleast 500ms to make a reset. Therefore you'll have
  171. to connect a small wire to the rb3-pin (refer to keyb.iff). This wire should
  172. be connected to GND if you are using an A500, if you are using an A1200 or an
  173. A2/3/4/000 it should be connected to +5v. I've been forced to do this since
  174. the keyboard handling on the A500 will totally hung if you try to send
  175. a resetwarning code. According to RKM HW-ref the A2/3/4/000 should have a
  176. resetwarning code sent before the keyboard performs a hard-reset so that is
  177. why you have to define what type of Amiga you are using.
  178.  
  179.     Should I note anything else?
  180.     ----------------------------
  181. Yes, there are some things worth noting:
  182.  
  183. As far as i know the A3000 & the A2000 uses the same type of 
  184. keyboard-connector. I haven't got any info on the A4000 keyboard-connector so
  185. you'll have to check that up yourself.
  186.  
  187. Do *NOT* forget to connect the shield between the AT-keyboard & the Amiga.
  188. Otherwise there is a big risc that your computer starts to behave strangely
  189. due to heavy interference.
  190.  
  191. The sourcecode is made to be assembled with Mpasm. Mpasm is a PIC-assembler
  192. for the PC that is available for free at www.microchip.com. So far I haven't
  193. seen any good PIC-assembler available for the Amiga that fulfils my needs.
  194.  
  195. If you want to make any changes in the source-code remember that the only
  196. parts in the source that you should change is the "keylookup-table" & the
  197. "specail mission commands routines". This project has been tested with 
  198. several AT-keyboards & I haven't found any yet that wont work with this
  199. project so you'd better leave the transmitting/receiving-routines
  200. the way they are. In fact there are keyboards that i have tested that works
  201. great with this project but does not work with some pc:s.
  202.  
  203. The reason that i have put a boot command on the pause key is that there
  204. are some cheap lousy AT-keyboards on the market that has big trouble
  205. handling three keys pressed at the same time. Don't be surprised if you
  206. find out that you own one of those AT-keyboards that can't handle any other
  207. three-keykombination than ctrl-alt-del.
  208.  
  209. Everytime you switch the power on or boot your Amiga with the AT-keyboard it
  210. will flash its leds & then the capslock-led will be lit (about 1s) while the
  211. PIC 16c84 is syncronizing with the Amiga. If the capslock-led does not lit as
  212. described you have an AT-keyboard that is not compatible with this project or
  213. you have failed in building this project properly.
  214.  
  215.     Is it possible I'm going to brake something?
  216.     --------------------------------------------
  217. Definitly yes if you are not careful enough. As always when building a
  218. project like this you should doublecheck everything before testing.
  219. Make really sure that you got the DIN-connectors connected the right way.
  220. If you check the pin-numbers shown in the schematics against the pin-numbers
  221. printed on the DIN-connector there should be no problem.
  222. When you have checked everything atleast twice you're ready to turn
  223. the power on & try to type something. Hopefully you will have a new
  224. perfectly working Amiga-keyboard.
  225.  
  226. A small hint for troubleshooting: If you get a lot of "'"-signs, you have
  227. switched KbClk & KbDat.
  228.  
  229.     Last words.
  230.     -----------
  231. If you have some ideas about this project that you want to carry out,
  232. dont hesitate to e-mail me if you have some trouble that you think
  233. I could help you with. Currently I am busy with my studies & it takes alot
  234. of my spare time so you'll have to keep that in mind if it takes some time
  235. before I can reply your letters.
  236.  
  237. Greetings goes out to:
  238. Eric Rudolph    Without the inspiration from his "IBM Keyboard Interface
  239.         Project" this project would never have been done.
  240.  
  241. Hans Luijten    for his extraordinary description on how to connect an
  242.         external keyboard to an A1200.
  243.  
  244. & finally:
  245.         GREETS GO OUT TO ALL AMIGA CREWS
  246.         WHO WORK HARD TO SHOW THE WORLD
  247.         THE GREATEST COMPUTER IS STILL
  248.             THE MIGGY!
  249.  
  250.     «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»«»«»«»«»
  251.     «» We are reasonable people. 100% independent. «»
  252.     «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»««»«»«»«»
  253.